package com.champaign.spring.config;

import com.champaign.spring.takeaway.FoodDeliveryPlatform;
import com.champaign.spring.takeaway.MeituanRider;
import com.champaign.spring.takeaway.Rider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * core config file
 * @author yd
 * @create 2019-04-25 14:33
 */
@Configuration
public class SpringConfig {

    @Bean
    public MeituanRider rider(){
        return new MeituanRider();
    }

    @Bean
    public FoodDeliveryPlatform foodDeliveryPlatform(){
        FoodDeliveryPlatform foodDeliveryPlatform = new FoodDeliveryPlatform("huangMenChickenRider");
        foodDeliveryPlatform.setRider(rider());
        return foodDeliveryPlatform;
    }
}
